use TestHelper;
use EntityBagTestHelper;
use ActionTestHelper;

sub testGetActionStatus{
    my $m = shift;

    print "Probando ACTION STATUS\n";

    my $st = $m->getActionStatus("SUCCESS");

    print ">Probando Tipo\n";
    if(ref($st) ne "ActionStatus"){
	print "--->ERROR: ".(ref($st))." ne ActionStatus\n";
    }else{
	print "    Tipo OK\n";
    }

    print ">Probando name\n";
    if($st->name ne "SUCCESS"){
	print "--->ERROR: ".$st->name." ne SUCCESS\n";
    }else{
	print "    Tipo OK\n";
    }

    print ">Probando is\n";
    if(!$st->is("SUCCESS")){
	print "--->ERROR: ".$st->name." is not SUCCESS\n";
    }else{
	print "    Tipo OK\n";
    }

}

sub testGetAction{
    my $mgr = shift;

    print "Probando obtencion de Acciones\n";

    my $action = $mgr->getAction("Action");
    testClass($action, "Action");
    testInjection($action, $mgr, "RESOURCE_MANAGER");
}


sub testGetComponent{
    my $mgr = shift;
    my ($componentName, $componentType) = (shift, shift);
    
    print "Probando obtencion de componente: ".$componentName." de tipo ".$componentType."\n";
    my $component = $mgr->getComponent($componentName);

    if(ref($component) ne $componentType){
	print "--->ERROR: ".(ref($component))." ne $componentType\n";
    }else{
	print "    Tipo OK\n";
    }
    
}
1;
